{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 读写文件\n",
    "\n",
    "从本质上讲，文件是用于存储数据的连续字节集。这些数据以特定格式组织，可以是任何像文本文件一样简单的数据，也可以像程序可执行文件一样复杂。最后，这些字节文件被翻译成二进制文件1，0以便计算机更容易处理。\n",
    "\n",
    "在操作系统上访问文件时，需要文件路径。文件路径是表示文件位置的字符串。它分为三个主要部分：\n",
    "\n",
    "文件夹路径：文件系统上的文件夹位置，后续文件夹由正斜杠/（Unix）或反斜杠\\（Windows）分隔\n",
    "文件名：文件的实际名称\n",
    "扩展名：文件路径的末尾预先设置了句号（.），用于表示文件类型\n",
    "\n",
    "https://docs.python.org/zh-cn/3/tutorial/inputoutput.html#reading-and-writing-files"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 写入文件\n",
    "\n",
    "write()方法write()方法将任何字符串写入打开的文件。 重要的是要注意，Python字符串可以是二进制数据，而不仅仅是文本。\n",
    "write()方法不会在字符串的末尾添加换行符(‘\\n‘)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
